package com.wuyixu.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

import com.github.pagehelper.PageInfo;
import com.wuyixu.domain.HouseOrder;
import com.wuyixu.domain.HouseVo;
import com.wuyixu.service.HouserOrderService;

@Controller
public class HouseOrderController {
	@Autowired
	private HouserOrderService hs;
	@RequestMapping("select")
	public String getAll(HouseVo vo,@RequestParam(defaultValue="1")Integer pageNum,Model model){
		PageInfo<HouseOrder> info = hs.getAll(vo, pageNum);
		model.addAttribute("info", info);
		model.addAttribute("vo", vo);
		return "show";
	}
	@RequestMapping("addH")
	public String addH(HouseOrder h){
		hs.addHouse(h);
		return "redirect:select";
	}
}
